/**
 * Created by Administrator on 2016/7/18.
 */
$(document).ready(function(){
    $("header img:nth-child(1)").click(function(){
        history.go(-1);
    });
    $("header p:nth-child(3)").click(function(){
        //var user_token =  sessionStorage.user_token;
        //var u_id = sessionStorage.u_id;
        var view_content = $(".mainPart1 textarea").val();
        var view_content1 = $(".mainPart2 textarea").val();
        if(view_content == ''){
            createWindow("请输入您宝贵的意见或建议！");
        }else{
            $.post(commonval+"/userView",{
                device:"wap",
                view_content:view_content,
                user_phone:view_content1
            },function(data){
                if(data.status == 1){
                    history.go(-1);
                    createWindow(data.msg);
                }else{
                    createWindow(data.msg);
                }
            });
        }
        function createWindow(msg) {
            var window =$("<section class='showMsg'></section>");
            var show = "<p>"+msg+"</p>";
            window.append(show);
            $("body").append(window);
            setTimeout("$('.showMsg').remove()",5000);
        }
    })
});
